<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Dynamic square</title>
    <style>
        .square-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            border: 2px solid blue;
            width: 300px;
            height: 200px;
        }

        .square-wrapper:hover {
            transition:width 2s,height 2s;
            width: 400px;
            height: 300px;
        }

        .square {
            background: red;
            width: 25%;
            padding-top:25%;
        }


    </style>
</head>
<body>
<div class="square-wrapper" style="margin:30px">
    <div class="square"></div>
</div>
</body>
</html>
